import instance from "@/request/request";
import type { Res } from '@/request/ResultApi';

//获取所有缺陷日志
export const getAllDefectlog = (size: number,
     current: number, 
     lineId: number,
     orderItemId:number,
     timeOrderBy:number): Res<null> =>{
        let str=""
        if(!Number.isNaN(lineId)&&lineId>=0)str+='&lineId='+lineId
        if(!Number.isNaN(orderItemId)&&orderItemId>=0)str+='&orderItemId='+orderItemId
        return instance.get(`/defectlog/all?size=${size}&current=${current}&timeOrderBy=${timeOrderBy}${str}`);
     }
 
//删除缺陷日志
export const removeDefectlog = (DefectLogId: number): Res<null> =>
    instance.post(`/defectlog/delete?DefectLogId=${DefectLogId}`);

//批量删除缺陷日志
export const removeDefectlogs = (data: []): Res<null> => instance.post("/defectlog/deletes", data);